<template>
  <div class="login-panel">
    <h2 class="title">后台管理系统</h2>
    <el-tabs type="border-card" stretch>
      <el-tab-pane label="账号登录">
        <AccountLogin ref="accountLoginRef"/>
      </el-tab-pane>
      <el-tab-pane label="手机登录">
        <PhoneLogin/>
      </el-tab-pane>
    </el-tabs>
    <div class="info-operation">
      <el-checkbox v-model="isRemember" label="记住密码"/>
      <el-link type="primary">忘记密码</el-link>
    </div>
    <el-button type="primary" class="login-btn" @click="login">登录</el-button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import AccountLogin from './AccountLogin.vue'
import PhoneLogin from './PhoneLogin.vue'
const isRemember = ref(true)
const accountLoginRef = ref<InstanceType<typeof AccountLogin>>()
const login = () => {
  accountLoginRef.value?.accountLogin(isRemember.value)
}
</script>

<style scoped lang="less">
.login-panel{
  width: 320px;
  .title{
    text-align: center;
  }
  .info-operation{
    display: flex;
    justify-content: space-between;
  }
  .login-btn{
    width: 100%;
  }
}
</style>